/*
 * @Author: 詹真琦(legendryztachi@gmail.com)
 * @Date: 2022-03-31 13:58:13
 * @LastEditors: 詹真琦(legendryztachi@gmail.com)
 * @LastEditTime: 2022-03-31 13:58:14
 * @FilePath: \code\cwp-front\pc-collaboration\src\handles\handle-list\modules\summary\more-sign.js
 * @Description: 多级会签
 */
import { getInsertNodeParams } from '@/handles/common/add-node/helper';
import globalData from '@/plugins/data';
import {fireEvent, getCollEventParams} from "@/handles/common/sdk";
import {useBaseInfoStore} from "@/store/modules/base-info";

export async function moreSign(initParams) {
    const businessData = useBaseInfoStore().baseInfo?.businessData || {};
    const eventParams = getCollEventParams(businessData, globalData);
    let eventResult = await fireEvent("moreSign", eventParams);
    if (!eventResult) {
        return;
    }
    multistageSign(await getInsertNodeParams.call(this, initParams, 'moreSign'));
    console.log('moreSign done');
}

export default function () {
    return new Promise( (resolve) => {
        moreSign.call(this);
        console.log('default moreSign done');
        resolve();
    });
}
